var app = getApp();

const { screenWidth } = wx.getSystemInfoSync() //获取了当前设备的系统信息对象,screenWidth 是一个表示屏幕宽度的数值，单位是 px

Component({
  data: {
    padding: 4,
    gridList:[],
    cardWidth: (screenWidth - 4 * 2 - 4) / 2, // 减去间距
  },

  lifetimes: {
    created() {
    },
    attached(){
      // console.log("!!!!")
      wx.request({
        url: 'http://192.168.43.252:8081/api/admin/photos/albums?current=1&size=10&keywords=',
        method:'Get',
        success:(res)=>{
          console.log("不再存在？？？")
          console.log(app.globalData.List);
          for(var index in res.data.data.recordList){
            app.globalData.List[index].src = res.data.data.recordList[index].albumCover
            app.globalData.List[index].content = res.data.data.recordList[index].albumName
            app.globalData.List[index].nickname = res.data.data.recordList[index].id;
             console.log(index);
          }
          console.log("?????")
          console.log(app.globalData.List)
          this.setData({
            gridList:app.globalData.List
          })
          // console.log(this.data.gridList[0])
        }
      })
    
    },

    ready(){
      
    },
    
  },





})
